import React from 'react';
import PropTypes from 'prop-types';
import Mouse from './MouseChild';
import Cat from './Cat';

export default class MouseTracker extends React.Component {
  render() {
    return (
      <div>
        <h1>移动鼠标!</h1>
        <Mouse>
          {mouse => (
            <Cat mouse={mouse} />
          )}
        </Mouse>
      </div>
    );
  }
}

Mouse.propTypes = {
  children: PropTypes.func.isRequired
};
